package com.itheima.zixi5.XianchengSafety;

public class Account {
    private String cardId;
    private double money;

    public Account() {
    }

    public Account(String cardId, double money) {
        this.cardId = cardId;
        this.money = money;
    }

    public String getCardId() {
        return cardId;
    }

    public void setCardId(String cardId) {
        this.cardId = cardId;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }
    public void drawMoney(double money){
String name = Thread.currentThread().getName();
if(this.money>= money){
    System.out.println(name+"取钱成功，取钱金额："+money);
    this.money -= money;
    System.out.println(name+"取钱成功，余额为："+this.money);
}else{
    System.out.println(name+"取钱失败，余额不足");
}
    }
}
